Skip to content

Fixed token refresh thread stopping on network failures - #195

Merged
samson0v merged 3 commits into
thingsboard:masterfrom
Prus-Oleksandr:IOTGW-763
Oct 14, 2026
Merged

samson0v merged 3 commits into
thingsboard:masterfrom
Prus-Oleksandr:IOTGW-763

Conversation

@Prus-Oleksandr

Copy link
Copy Markdown
Contributor

Fixes #71

  • When the network was down at the moment the token had to be refreshed, the refresh thread of RestClient stopped on the exception, and the token was never refreshed again.
  • The thread now keeps running: it retries the refresh every refresh_retry_delay seconds (5 by default) until the server is reachable again, logs the full traceback only for the first failure, and stop() ends it without waiting for the pause.
  • Added tests for a refresh during a network failure and for stopping the client between retries.

Comment thread tb_rest_client/rest_client.py Resolved
Comment thread tb_rest_client/rest_client.py Resolved
Comment thread tb_rest_client/rest_client.py Resolved
@samson0v
samson0v merged commit fe00f2d into thingsboard:master Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Unhandled exception in rest_client_base.py

2 participants